$block-width: 174px;
$block-padding: 3px;
$block-screenshot-width: $block-width - $block-padding * 2;
$block-screenshot-height: $block-screenshot-width / 16 * 9;
$block-screenshot-img-width: $block-screenshot-width - 6px;
$block-screenshot-img-height: $block-screenshot-height - 6px;

.block {
  background-color: #fff;
  border-radius: 3px;
  box-shadow: 0px 0px 2px 1px rgba(47, 53, 55, 0.1);
  margin-bottom: 12px;
  margin-left: 6px;
  margin-right: 6px;
  overflow: hidden;
  position: relative;
  width: $block-width;
  height: $block-screenshot-width / 16 * 9 + 44px + 6px;
  padding: $block-padding;
  transition: all 0.1s ease-in;
  &:hover {
    box-shadow: 0px 0px 2px 1px rgba(48, 128, 254, 1);
  }
  .screenshot {
    width: $block-screenshot-width;
    height: $block-screenshot-width / 16 * 9;
    background-color: #f1f1f1;
    padding: 3px;
    border-radius: 2px;
    text-align: center;
    .screenshot-img {
      width: $block-screenshot-img-width;
      height: $block-screenshot-img-width / 16 * 9;
      display: block;
      background-size: contain;
      background-repeat: no-repeat;
      background-position: 50% 50%;
    }
    .custom-screenshot-img {
      max-height: $block-screenshot-img-width / 16 * 9;
      max-width: $block-screenshot-img-width;
    }
  }
  .title-wrapper {
    font-size: 12px;
    height: 44px;
    padding-top: 5px;
    color: #666;
    overflow: hidden;
    .title-body {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .title {
      flex: auto;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .class-name {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .title {
      font-size: 14px;
      height: 20px;
      line-height: 20px;
    }
    .class-name {
      font-size: 12px;
      height: 18px;
      line-height: 18px;
      color: #999;
    }
  }
  &:hover {
    .block-flipcard {
      display: block;
    }
  }
  .block-flipcard {
    display: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 3px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
  }
  .block-flipcard-body {
    font-size: 12px;
    color: #666666;
    padding: 14px;
    padding-bottom: 0;
    h2 {
      font-size: 14px;
      color: #333333;
      margin: 0;
    }
    p {
      font-size: 12px;
      line-height: 18px;
      margin: 0;
    }
  }
  .block-flipcard-panel {
    position: absolute;
    height: 40px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    bottom: 0;
    left: 0;
    .preview,
    .repo {
      // color: $color-text1-2;
      padding: 0 10px;
      &:hover {
        cursor: pointer;
        color: $color-link-3;
      }
    }
  }
}
